<extend name="Index/index" />

<block name="link">
    <title>Store</title>
    <meta charset="utf-8">
    <!-- <link href="__PUBLIC__/store_public/css/global.css" rel="stylesheet" type="text/css" /> -->
    <link href="__PUBLIC__/store_public/css/global_schinese.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/publicheader.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/storeheader.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/store.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/store_featured.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/buttons.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/valvefooter.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/store1.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/cart.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">

    <script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/store_public/js/jquery-1.7.1.min.js"></script>
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
    <link href="__PUBLIC__/store_public/css/global_schinese.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/publicheader.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/storeheader.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/store.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/store_featured.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/buttons.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/store_public/css/itemdetails.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/store_public/css/buttons.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/store_public/css/valvefooter.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/store_public/unitegallery/css/normalize.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/store_public/unitegallery/css/default.css">
    <link rel='stylesheet' href='__PUBLIC__/store_public/unitegallery/css/unite-gallery.css' type='text/css' />
    <script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script type='text/javascript' src='__PUBLIC__/store_public/unitegallery/js/jquery-11.0.min.js'></script>   
    <script type='text/javascript' src='__PUBLIC__/store_public/unitegallery/js/unitegallery.min.js'></script>  
    <script type='text/javascript' src='__PUBLIC__/store_public/unitegallery/themes/default/ug-theme-default.js'></script>
    <link rel='stylesheet' href='__PUBLIC__/store_public/unitegallery/themes/default/ug-theme-default.css' type='text/css' />
</block>

<block name="main">
    <body class="MainBackgroundImage">
        <div class="StorePageBody" class="Hidden">
            <!-- StoreContainer start -->
            <div class="StoreContainer">
                <div class="StoreContainerBg"></div>
                <div id="StoreTabs">
                    <span id="StoreTabButtons">
                        <a href="<{:U('Home/Store/index')}>" class="StoreTab DarkGrayButton NoSelect StoreTabMenuButton ">主打</a>
                        <a href="<{:U('Home/Store/list?list=1')}>" <if condition="$mark eq 1">class="StoreTab NoSelect  StoreTabActive GrayButton"<else />class="StoreTab DarkGrayButton NoSelect StoreTabMenuButton" 
                        </if>>英雄套装</a>
                        <a href="<{:U('Home/Store/list?list=2')}>"  <if condition="$mark eq 2">class="StoreTab NoSelect  StoreTabActive GrayButton"<else />class="StoreTab DarkGrayButton NoSelect StoreTabMenuButton"
                        </if>>
                        物品</a>
                        <a href="<{:U('Home/Store/list?list=3')}>"  <if condition="$mark eq 3">class="StoreTab NoSelect  StoreTabActive GrayButton"<else />class="StoreTab DarkGrayButton NoSelect StoreTabMenuButton" 
                        </if>>职业商店</a>
                        <span class="LowerBg"></span>
                    </span>
                    <span class="StoreTabPadding"></span>
                    <div id="StoreSearchForm">
                        <form action="<{:U('Home/Store/list?list=search')}>" method="post" name="form1" id="form1">
                        <input type="text" id="StoreSearchInput" autocomplete="off" spellcheck="false" placeholder="搜索" name="search"/>
                        </form>
                        <div id="storeSearchButton" class="glyphicon glyphicon-search" style="position: absolute;top: 5px;right: 5px;width: 19px;height: 19px;background-image: url(http://cdn.dota2.com.cn/apps/dota2/images/store/icon_search.png?1);background-size: 19px 19px;background-repeat: no-repeat;pointer-events: none;font-family: Arial;"></div>
                    </div>

                    <div id="CartButton" class="NoSelect CartHeaderButton NoItems">
                        <span id="CartButtonText" class="">
                            <div id="CartButtonTextIcon"></div>
                            <a href="<{:U('Home/Cart/index')}>">购物车</a>
                        </span>
                        </span>
                    </div>
                </div>
    
                <!-- ContentContainer  start -->
                <div id="ContentContainer">
                    <!-- Featured start -->
                    <div id="Featured" class="Hidden" style="display: block;">
                        <div class="PreviewContainer">
                            <div class="DarkBlueGradient ItemDetailsTopGradient"></div>
                            <div id="PreviewSubContainerLeft">
                                <h2 class="Title"><{$newlist.g_name}></h2>
                                <div style="clear: both;"></div>
                            </div>
                            <div style="margin-top:50px;"></div>
                            <div id="gallery" style="display:none;">
                            <volist name="newlist" id="vo">
                                <img alt="Preview Image 1"
                                    src="/Uploads/store/<{$vo.g_icon}>"
                                    data-image="/Uploads/store/<{$vo.g_icon}>"
                                    data-description="<{$vo.g_name}>">
                            </volist>
                            </div>
                             <div id="PreviewSubContainerRight">
                                <div class="TopContainer">
                                    <div class="ItemAttribs">
                                        <p>
                                            <span class="AttribName">英雄：</span>
                                            <span class="AttribValue">其它</span>
                                            <br>
                                            <span class="AttribName">槽位：</span>
                                            <span class="AttribValue">无</span>
                                            <br>
                                            <span class="AttribName">稀有度：</span>
                                            <span class="Rarity" style="color: #b0c3d9">
                                                <switch name="g_rank">
                                                <case value='0'>普通</case>
                                                <case value='1'>稀有</case>
                                                <case value='2'>至宝</case>
                                                <case value='3'>神话</case>
                                                <case value='4'>传说</case>
                                                <case value='5'>普通</case>
                                                </switch>
                                            </span>
                                            <br>
                                            <span class="AttribName">商品星级：</span>
                                            <span class="AttribValue"><{$star}></span>
                                            <br>
                                        </p>
                                    </div>
                                </div>
                                <div id="DescriptionContainer">
                                    <p class="Description">本物品无法出售。</p>
                                    <ul>
                                        <li>
                                            <{$detail}>
                                        </li>
                                        <li>
                                            <br>
                                        </li>
                                        <li></li>
                                        <li>（不可删除）</li>
                                    </ul>
                                </div>
                                <br>
                                <br>
                            </div>
                            <div class="Hidden myhiddenid"><{$gid}></div>
                            <div style="margin-top:60px;float:right;margin-right:20px;" data-toggle="modal" data-target="#myModal">
                                <button class="btn btn-success mySc">收藏</button>
                            </div>
                            <div class="ButtonsAndPriceContainer" style="margin-top:260px;">
                                <div class="ButtonContainer contentBox" data-toggle="modal" data-target="#myModal">
                                    <a class="NoSelect GreenButton BigButton ItemDetailsAddToCartButton_Base ItemDetailsAddToCartButton" href="#">
                                        <span class="ItemDetailsAddToCartButton_BaseText">放入购物车内</span>
                                    </a>
                                </div>
                                <div class="Price contentBox">
                                    <{$newlist.price}> 刀币</div>
                            </div>
                            <div style="clear: both"></div>
                            <div style="margin-top:100px;"></div>
                            <h2>用户评价</h2>
                            <div style="margin-top:30px;"></div>
                            <table class="table">
                                <tr>
                                    <th>用户</th>
                                    <th>内容</th>
                                    <th>评价星级</th>
                                    <th>评价时间</th>
                                </tr>
                            <volist name="list" id="vo">
                                <tr>
                                    <td><img src="<{$vo.icon}>" width="50"><p><{$vo.nickname}></p></td>
                                    <td><{$vo.app_content}></td>
                                    <td><{$vo.app_star}> 星级</td>
                                    <td><{$vo.app_time|date="Y-m-d",###}></td>
                                </tr>
                            </volist>
                            <tr><td></td><td></td><td></td><td></td></tr>
                            </table>
                            <div style="margin-top:80px;">
                                <button class="btn btn-info" onclick="appraise()">评价</button>
                            </div>
                        </div>
                    </div>
                    <!-- Featured end -->
                </div><!-- ContentContainer  end -->

            </div><!-- StoreContainer end -->
            <div class="ValveFooter"></div>
        </div>
        <!-- StorePageBody end -->

        <!-- Modal -->
        <div class="modal fade " id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="position: fixed; z-index: 9999; top: 180px; left: 15px;">
            <div class="modal-dialog">
                <center>
                    <div class="modal-content" style="background-image: url(http://cdn.dota2.com.cn/apps/dota2/images/store/bg_modal.jpg);width: 458px;height: 216px;">
                        <div id="CartConfirmModalSuccess" style="display: block;">
                            <h2 style="margin: 0;padding: 36px 0 12px 0;font-size: 20px;font-weight: normal;color: #c6c6c6;">物品已加入购物车。</h2>
                            <p style="padding: 10px 0 13px 0;;"></p>
                            <div class="GreenButton BigButton ModalConfirmButton" onclick="CloseCartConfirmDlg();" data-dismiss="modal">继续购物</div>
                        </div>
                    </div>
                </center>
            </div>
        </div>
    
     <script type="text/javascript">
        jQuery(document).ready(function(){
            jQuery("#gallery").unitegallery();
        });
    </script>

    <script>
        $('#StoreSearchInput').blur(function(){
            document.form1.submit();
        });

        $('.mySc').click(function(){
            var gid = $('.myhiddenid').html();
            $.ajax({
                type: 'post',
                url: '<{:U("Home/Store/addCollection")}>',
                data: 'gid='+gid,
                dataType: 'json',
                async: false,
                success:function(msg){
                    if(msg == 1){
                        $('.modal-content').empty();
                        $('.modal-content').html('<h2 style="margin: 0;padding: 36px 0 12px 0;font-size: 20px;font-weight: normal;color: #c6c6c6;">收藏成功</h2><p style="padding: 10px 0 13px 0;"></p><div class="GreenButton BigButton ModalConfirmButton" data-dismiss="modal">继续欣赏</div>');
                    }else{
                        $('.modal-content').empty();
                        $('.modal-content').html('<h2 style="margin: 0;padding: 36px 0 12px 0;font-size: 20px;font-weight: normal;color: #c6c6c6;">已经收藏啦~</h2><p style="padding: 10px 0 13px 0;"></p><div class="GreenButton BigButton ModalConfirmButton" data-dismiss="modal">再继续看看吧~</div>');
                    }
                }
            });
        });

        function appraise(){
            var g_id = $('.myhiddenid').html();
            $.ajax({
                type: 'post',
                url: '<{:U("Home/Appraise/status")}>',
                data: 'gid='+g_id,
                dataType: 'json',
                async: false,
                success:function(msg){
                    if(msg == null){
                        alert('没有权限评价该商品,快去购买吧!!!');
                    }else{
                        var url = '<{:U("Home/Appraise/index")}>?gid='+g_id;
                        window.location = url;
                    }
                }
            });
        }

        $('.ButtonContainer').click(function(){
            var gid = $(this).parent().prevAll('.myhiddenid').html();
            $.ajax({
                type: 'post',
                url: '<{:U("Home/Cart/addCart")}>',
                data: 'gid='+gid,
                dataType: 'json',
                async: false,
                success:function(msg){
                    if(msg == 'false'){
                        $('.modal-content').empty();
                        $('.modal-content').html('<h2 style="margin: 0;padding: 36px 0 12px 0;font-size: 20px;font-weight: normal;color: #c6c6c6;">请先登录~</h2><p style="padding: 10px 0 13px 0;"></p><div class="GreenButton BigButton ModalConfirmButton" data-dismiss="modal" onclick="login()">登录</div>');
                    }else{
                         $('.modal-content').empty();
                         $('.modal-content').html('<h2 style="margin: 0;padding: 36px 0 12px 0;font-size: 20px;font-weight: normal;color: #c6c6c6;">物品已加入购物车。</h2><p style="padding: 10px 0 13px 0;"></p><div class="GreenButton BigButton ModalConfirmButton" data-dismiss="modal" onclick="CloseCartConfirmDlg();">继续购物</div>');
                    }
                }
            });
        });

        function login(){
            var url = "<{:U('Home/Login/index')}>";
            window.location = url;
        }
    </script>
</block>
</body>

</html>